package org.jground.rx.def.apps.commons;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.accounting.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class Document extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.commons.Document";

    private static final String uploadTime ="uploadTime";
    private static final String title ="title";
    private static final String description ="description";
    private static final String location ="location";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String uploadTime ="uploadTime";
        public static final String title ="title";
        public static final String description ="description";
        public static final String location ="location";
        public static final String $CREATOR ="$CREATOR";
    }

    public static Document createNew() { return new Document(RXObjectService.getInstance().create(moid)); }

    public static Document getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new Document(mod);
    }

    public static Document[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        Document[] res = new Document[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new Document(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static Document[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static Document[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        Document[] res = new Document[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new Document(mod);
            i++;
        }
        return res;
    }

    public static Document wrap(IRXObjectSynopsis mod) { 
        return new Document(mod);
    }

    private Document(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getUploadTimeLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, uploadTime).getLabel();
    }

    public static String getUploadTimeDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, uploadTime).getDescription();
    }

    public void setUploadTime(String dateTimeValue) {
        rxObject.set(uploadTime, _to_String(dateTimeValue));
    }

    public String getUploadTime() {
        return _to_String(rxObject.getCurrentValue(uploadTime));
    }

    public static String getTitleLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, title).getLabel();
    }

    public static String getTitleDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, title).getDescription();
    }

    public void setTitle(String string) {
        rxObject.set(title, _to_String(string));
    }

    public String getTitle() {
        return _to_String(rxObject.getCurrentValue(title));
    }

    public static String getDescriptionLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getLabel();
    }

    public static String getDescriptionDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getDescription();
    }

    public void setDescription(String text) {
        rxObject.set(description, _to_String(text));
    }

    public String getDescription() {
        return _to_String(rxObject.getCurrentValue(description));
    }

    public static String getLocationLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, location).getLabel();
    }

    public static String getLocationDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, location).getDescription();
    }

    public void setLocation(String string) {
        rxObject.set(location, _to_String(string));
    }

    public String getLocation() {
        return _to_String(rxObject.getCurrentValue(location));
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
